<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "{{%case_products}}".
 *
 * @property string $case_id 产品属性 ID
 * @property string $product_id 产品 ID
 */
class CaseProducts extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%case_products}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['case_id', 'product_id'], 'required'],
            [['case_id', 'product_id'], 'integer'],
            [['case_id', 'product_id'], 'unique', 'targetAttribute' => ['case_id', 'product_id']],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'case_id' => '产品属性 ID',
            'product_id' => '产品 ID',
        ];
    }
}
